package com.bee.mydiary.record;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;
import android.widget.SimpleAdapter;

import com.bee.mydiary.R;

public class ShowSoundList extends Activity {

	private String TAG = "ShowSoundList";
	private String ID = "id";
	private String NAME = "name";
	private String DATE = "date";
	private ListView msoundlist;
	private SimpleAdapter msoundAdapter;
	private List<HashMap<String,String>> soundlist;
	private RecordServer mrecordserver = null;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.record_list);
		msoundlist = (ListView) findViewById(R.id.soundlist);
		soundlist = new ArrayList<HashMap<String,String>>();
		mrecordserver = new RecordServer(this);
		
	}

	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
		soundlist = mrecordserver.getRecord();
		
		msoundAdapter = new SimpleAdapter(this,
				soundlist,
				R.layout.record_item,
				new String[]{ID,NAME,DATE},
				new int[]{R.id.id,R.id.name,R.id.date}
				);
		
		msoundlist.setAdapter(msoundAdapter);		
	}
	

}
